<template>
  <div>
    <x-header id="header" :left-options="{backText: ''}">产品详情</x-header>
    <div class="main-header">
      <div class="con">
        <div class="head">
          <div class="name">{{goodDetail.subheading}}</div>
          <div class="labelList">
            <div class="label" v-for="item in goodDetail.label">{{item}}</div>

          </div>
        </div>
        <div class="content">
          <div class="intro-title">产品介绍</div>
          <div class="intro-applyTo">
            <div class="intro-applyTo-title">适用人群：</div>
            <div class="intro-applyTo-content">{{goodDetail.scope}}</div>
          </div>
          <div class="intro-applyTo">
            <div class="intro-applyTo-title">额度范围：</div>
            <div class="intro-applyTo-content">3万-50万，高达月供金额55倍</div>
          </div>
          <div class="vux-1px-b noName"></div>
          <div class="request-title">准入条件</div>
          <div class="request-item" v-for=" (item, index) in requestList" :key="index">
            <img class="request-item-icon" src="../../../static/img/on.png" />
            <div class="request-item-content">{{item}}</div>
          </div>
        </div>
        <div class="intro">
          <x-button class="intro-button">立即推荐</x-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getGoodsDetail } from '@/api/good'
export default {
  name: 'detail',
  data () {
    return {
      goodDetail: '',
      requestList:[
        '申请人工作关系、房产、户籍三者之一须在本地；',
        '放贷发放机构须为银行，还贷方式须为按月期供；',
        '房贷贷款期限>24个月，房贷已正常还款≥1个月；',
        '若房贷已结清，结清时间≤12个月。'
      ]
    }
  },
  mounted () {
    getGoodsDetail(this.$route.query.id).then( data => {
      if (data.label) data.label = data.label.split(',')
      this.goodDetail = data
    })
  }
}
</script>

<style scoped>
.con {
  margin: 1rem;
  background: #fff;
  border-radius: 10px 10px 0 0;
}
.head {
  border-radius: 10px 10px 0 0;
  background-image: url("../../../static/img/goodBack.png");
  background-size: 100% 100%;
  padding: 1rem;
}
.name {
  font-size: 20px;
  color: #FFFFFF;
  padding-bottom: 1rem;
}
.labelList {
  display: flex;
}
.label {
  margin-right: 0.7rem;
  padding: 0 0.7rem;
  border: 1px solid #FFFFFF;
  border-radius: 14px;
  height: 1.7rem;
  line-height: 1.7rem;
  text-align: center;
  color: #fff;
}
.content {
  padding: 1rem;
}
.intro-title {
  color: #8D8D8D;
  padding-bottom: 1rem;
}
.intro-applyTo{
  display: flex;
  padding-bottom: 0.6rem;
}
.intro-applyTo-title{
  color: #8D8D8D;
}
.intro-applyTo-content{
  flex: 1;
  color: #5B5B5B;
}
.noName {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}
.request-title {
  color: #8D8D8D;
}
.request-item {
  display: flex;
}
.request-item-icon {
  padding: 0.35rem 0.7rem 0 0;
  width: 0.8rem;
  height: 0.8rem;
}
.request-item-content {
  flex: 1;
  color: #5B5B5B;
}
.intro {
  padding: 3rem 1rem 1rem;
}
.intro-button {
  background: #F14E2C;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  line-height: 3rem;
}
</style>
